<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
</head>
<body>
	<div id="app">
		
	</div>
	<script type="text/javascript" src="./vue.min.js"></script>
	<script src="./node_modules/axios/dist/axios.js"></script>

	<script type="text/javascript">

		
		var App = {
			template:`
				<div>
					
					<button @click = 'sendAjax'>发请求</button>
					{{msg}}
				</div>

			`,
			data(){
				msg:''
			},
			methods:{
				sendAjax(){
					this.$axios.get('http://127.0.0.1:8888/')
					.then(res=>{
						console.log(res);
						this.msg=res
					})
					.catch(err=>{
						console.log(err);
					})
				}
			}

		};

		Vue.prototype.$axios = axios
		
		new Vue({
			el:'#app',
			template:`<App />`,
			components:{
				App
			}
		});
	</script>
	
</body>
</html>